/**
 *<p>Copyright: Copyright (c) 2012</p> 
 *<p>Company: SCPII</p>
 *<p>Project:scpii-api</p>
 *@author xiezhouyan
 *@Date 2013-4-7 下午4:09:12
 *@version 1.0
 *@description:
 */
package com.scpii.api.controller.common;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.scpii.api.domain.common.FieldValues;
import com.scpii.api.service.common.FieldValuesService;

@Controller
@RequestMapping("/common/fieldValues")
public class FieldValuesController {

	@Resource
	private FieldValuesService fieldValuesService;

	@PreAuthorize("hasRole('ROLE_USER')")
	@RequestMapping(value = "/target/{targetId}", method = RequestMethod.GET)
	@ResponseBody
	public List<FieldValues> getFieldValuesByTargetId(
			@PathVariable("targetId") Long targetId) {
		return fieldValuesService.getFieldValuesByTargetId(targetId);
	}
}